<template>
  <div id="app">
    <!-- 动画标签 -->
   <transition name="router-fade" mode="out-in">
    <!-- keep-alive组件缓存 -->
    <keep-alive>
      <router-view v-if="$route.meta.keepAlive"></router-view>
    </keep-alive>
   </transition>
   <!-- 当没有缓存痕迹的时候则直接执行动画 -->
   <transition name="router-fade" mode="out-in">
      <router-view v-if="!$route.meta.keepAlive"></router-view>
   </transition>
   <SvgIcon></SvgIcon>
  </div>
</template>

<script>
import SvgIcon from './components/common/svg.vue';
export default {
  name: 'App',
  components: {
    SvgIcon
  }
}
</script>

<style lang="scss">
 .router-fade-enter-active,.router-fade-leave-active {
  transition: opacity 0.3;;
 }
</style>
